//	--------------------------------------------------------------------
//	Copyright(C) 2006,2007 Zhao Yukun. All rights reserved.
//	This file is a part of the Xeres system.
//	Xeres 2007
//	Contact : xeres.engine@gmail.com
//	$(reservedInfo)
//	$(reservedDeclaration)
//	--------------------------------------------------------------------
///	@file	<CEffectCompiled9.h>
///	@path	~/src/graphics/dx9/
///	@date	2007/11/21
///	@desc	DX 9's compiled effect.

#pragma once

#include "xeres.h"

#include "graphics/IEffectCompiled.h"
#include "graphics/dx9/CDevice9.h"

#include <d3dx9.h>

namespace xeres {

	/*!
		\class	CEffectCompiled9
		\brief	DX 9's compiled effect.
	*/
	class CEffectCompiled9 : public IEffectCompiled
	{
	public:

		/// \ctor
		CEffectCompiled9( RefWeak<IEffect> effect , ID3DXBuffer * buffer );

		/// \dtor
		virtual ~CEffectCompiled9( void );

		DECL_IOBJECT_CLASS( CEffectCompiled9 , IEffectCompiled );

	public:

	//@ interface

		/*!
			\brief		Get compiled effect instance.
		*/
		virtual RefPass<IEffect> GetEffect( void );

		/*!
			\brief		Get compiled byte code size.
		*/
		virtual size_t GetCompiledSize( void );

		/*!
			\brief		Get compiled byte code.
		*/
		virtual const void * GetCompiledData( void );

	private:
	
	//@ data

		Ref<IEffect>		m_effect;
		ID3DXBuffer *		m_buffer;
	};

} // namespace xeres
